package cnooc.autoControl.service.impl;

import java.util.List;
import cnooc.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import cnooc.autoControl.mapper.AutoControlStrategyMapper;
import cnooc.autoControl.domain.AutoControlStrategy;
import cnooc.autoControl.service.IAutoControlStrategyService;

/**
 * 自动控制策略Service业务层处理
 * 
 * @author chen
 * @date 2025-07-19
 */
@Service
public class AutoControlStrategyServiceImpl implements IAutoControlStrategyService 
{
    @Autowired
    private AutoControlStrategyMapper autoControlStrategyMapper;

    /**
     * 查询自动控制策略
     * 
     * @param id 自动控制策略主键
     * @return 自动控制策略
     */
    @Override
    public AutoControlStrategy selectAutoControlStrategyById(Long id)
    {
        return autoControlStrategyMapper.selectAutoControlStrategyById(id);
    }

    @Override
    public AutoControlStrategy selectAutoControlStrategyByJobId(Long jobId) {
        return autoControlStrategyMapper.selectAutoControlStrategyByJobId(jobId);
    }

    /**
     * 查询自动控制策略列表
     * 
     * @param autoControlStrategy 自动控制策略
     * @return 自动控制策略
     */
    @Override
    public List<AutoControlStrategy> selectAutoControlStrategyList(AutoControlStrategy autoControlStrategy)
    {
        return autoControlStrategyMapper.selectAutoControlStrategyList(autoControlStrategy);
    }

    /**
     * 新增自动控制策略
     * 
     * @param autoControlStrategy 自动控制策略
     * @return 结果
     */
    @Override
    public int insertAutoControlStrategy(AutoControlStrategy autoControlStrategy)
    {
        autoControlStrategy.setCreateTime(DateUtils.getNowDate());
        return autoControlStrategyMapper.insertAutoControlStrategy(autoControlStrategy);
    }

    /**
     * 修改自动控制策略
     * 
     * @param autoControlStrategy 自动控制策略
     * @return 结果
     */
    @Override
    public int updateAutoControlStrategy(AutoControlStrategy autoControlStrategy)
    {
        autoControlStrategy.setUpdateTime(DateUtils.getNowDate());
        return autoControlStrategyMapper.updateAutoControlStrategy(autoControlStrategy);
    }

    /**
     * 批量删除自动控制策略
     * 
     * @param ids 需要删除的自动控制策略主键
     * @return 结果
     */
    @Override
    public int deleteAutoControlStrategyByIds(Long[] ids)
    {
        return autoControlStrategyMapper.deleteAutoControlStrategyByIds(ids);
    }


    /**
     * 批量删除自动控制策略
     *
     * @param jobId 需要删除的自动控制策略主键
     * @return 结果
     */
    @Override
    public int deleteAutoControlStrategyByJobId(Long[] jobId)
    {
        return autoControlStrategyMapper.deleteAutoControlStrategyByJobId(jobId);
    }

    /**
     * 删除自动控制策略信息
     * 
     * @param id 自动控制策略主键
     * @return 结果
     */
    @Override
    public int deleteAutoControlStrategyById(Long id)
    {
        return autoControlStrategyMapper.deleteAutoControlStrategyById(id);
    }
}
